
#include "FlyweightA.h"
#include <utility>
#include <iostream>

using namespace npFlyweight;
using namespace std;


FlyweightA::FlyweightA() : Flyweight() // class inheritance
{
    //To initialize data member;
}

FlyweightA::~FlyweightA()
{
    //To delete dynamic data member
}

FlyweightA::FlyweightA(const FlyweightA& cpy) : Flyweight(cpy) // class inheritance
{
    //To copy data member
}

FlyweightA& FlyweightA::operator=(const FlyweightA& asn)
{
    if (this == &asn)
    {
        return *this;
    }
    else
    {
        //To invoke base class operator=
        Flyweight::operator=(asn);
        //To assign data member, note to delete dynamic member if exists.
        
        return *this;
    }
}

FlyweightA::FlyweightA(FlyweightA&& mov) noexcept : Flyweight(move(mov))  // class inheritance
{
    //to move data
}

FlyweightA& FlyweightA::operator=(FlyweightA&& mva) noexcept
{
    if (this == &mva)
    {
        return *this;
    }
    else
    {
        //to inform base class to move data
        Flyweight::operator=(move(mva));
        // to move data
        
        return *this;
    }
}

FlyweightA* FlyweightA::clone() const
{
    //return new
    return new FlyweightA(*this);
}

//other constructors

//public methods
void FlyweightA::operate(int n) throw()
{
    cout << "Flyweight A: " << n << endl;
}

//protected methods

//private methods

//others
